<html>
<?php
include ("../../../../PCO.php");
include ("../../../../global-themis/functions/function_graph_2.php");
include ("../../../../global-themis/functions/functions.php");
include ("../../../../global-themis/Classes/client.class");
$compte_array=array();
$num_cli="";
if(isset($_GET['num_cli'])){
	$num_cli=$_GET['num_cli'];
	if(strlen($num_cli)==6)
	$num_cli="0".$num_cli."";
	$client= new Client();
	$client->setNum($num_cli);
	$compte_array = $client->getComptesByNum($num_cli);
}
?>
<head>
 <link rel='stylesheet' type='text/css' href='../../../../global-themis/css/themisstyle.css'/>
<script src="../../../../global-themis/js/jquery.js"></script>
<script type="text/javascript">
function OuvrirPopup(page) {
// le POPUP
      window.open(page, "comments", "toolbar=no, status=yes, scrollbars=yes, resizable=yes, width=1100, height=600");
}
</script>
<script>
$(document).ready(function(){
		$("#container").empty().html('<img src="../../../../global-themis/images/load.gif" />');
	});
</script>
<script>
$(document).ready(function(){
	$("#selec_compte").change(function(){
		$("#container").empty().html('<img src="../../../../global-themis/images/load.gif" />');
		})	
	});
</script>
<script type="text/javascript">
$(document).ready(function(){
// si on change le select, on charge le graphe...
	$("#selec_compte").change(function(){
		var graph = $("#selec_compte").val();
		var wid = screen.width/3.34;
		var hei = screen.height/3.75;
		var dataString = 'selec_compte='+ graph+'&wid='+wid+'&hei='+hei;
		$.ajax	({
			type: "POST",
			url: "./php-ajax/get_chart.php",
			data: dataString,
			cache: false,
			success: function(html){
				$("#container").html(html);
			},
			error: function(xhr, status, errorThrown) {
					alert('compte.php' + ' : error ajax - contactez DESI : status '+ status + ' && ' + errorThrown);
			}
		});
	});
});
</script>
<script type="text/javascript">
$(document).ready(function(){
// par default, le compte qui commence par 251100EUR...
		var graph = $("#selec_compte").val();
		var wid = screen.width/3.34;
		var hei = screen.height/3.75;
		var dataString = 'selec_compte='+ graph+'&wid='+wid+'&hei='+hei;
		$.ajax	({
			type: "POST",
			url: "./php-ajax/get_chart.php",
			data: dataString,
			cache: false,
			success: function(html){
				$("#container").html(html);
			}
		});
});
</script>
<script type="text/javascript">
$(document).ready(function(){
// le bouton du zoom
	$("#popup").click(function(){
		var graph = $("#selec_compte").val();
		OuvrirPopup("./zoom/zoom_compte.php?selec_compte="+graph);
	});
});
</script>
</head>
<body>
	<font color='white'></font>
	<select name='selec_compte' id='selec_compte' >
				<?php
					 echo getOptions($compte_array, ""); 
				?>
				</select>
	<a id='popup'>Zoom </a>
<div id='container'></div>
</body>
</html>